package com.sirdc.modules.bnp.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sirdc.modules.bnp.dao.SysNodeScheduleDao;
import com.sirdc.modules.bnp.filter.SysNodeScheduleFilter;
import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;

import net.huashitong.node.entity.NodeSchedules;

@Service
public class SysNodeScheduleService extends StringPKService<NodeSchedules> {
	
	@Autowired
	private SysNodeScheduleDao scheduleDao;
	
	@Autowired
	private SysTableService tableService;
	@Override
	protected BaseDao<NodeSchedules, String> getDao() {
		// TODO Auto-generated method stub
		return scheduleDao ;
	}
	public List<NodeSchedules> query(SysNodeScheduleFilter filter,String proId){
		return scheduleDao.query(filter,proId);
	}
	public NodeSchedules getNodeSchedules(String proId,String nodeId){
		return scheduleDao.getNodeSchedules(proId, nodeId);
	}
	@Override
	protected void beforeSave(NodeSchedules obj) {
		obj.setSysId(tableService.updateMaxSysId("t_bnp_node_schedule", null));
	}
	public void saveNodeSchedules(NodeSchedules schedule) {
		scheduleDao.save(schedule);
	}
	public void setNodeInfo(String sysId,String resUser,String resUserPhone,String planTime){
		scheduleDao.setNodeInfo(sysId, resUser, resUserPhone, planTime);
	}
	public void deleteByProjectId(String projectId){
		scheduleDao.deleteByProjectId(projectId);
	}
}
